package com.sk.auth.authtication.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class AuthticationController {

    @Autowired
    private RestTemplate restTemplate;

    @RequestMapping(value = "/authtication/{userid}", method = RequestMethod.GET)
    public String echo(@PathVariable String userid) {
        return restTemplate.getForObject("http://organization/user/" + userid, String.class);
    }
}
